package com.cookiesoft.activity.service.impl;

import java.util.List;
        import com.cookiesoft.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cookiesoft.activity.mapper.ZhenCdkeyMapper;
import com.cookiesoft.activity.domain.ZhenCdkey;
import com.cookiesoft.activity.service.IZhenCdkeyService;

/**
 * 礼包码Service业务层处理
 *
 * @author anc
 * @date 2024-11-06
 */
@Service
public class ZhenCdkeyServiceImpl implements IZhenCdkeyService {
    @Autowired
    private ZhenCdkeyMapper zhenCdkeyMapper;

    /**
     * 查询礼包码
     *
     * @param cdkeyId 礼包码主键
     * @return 礼包码
     */
    @Override
    public ZhenCdkey selectZhenCdkeyByCdkeyId(Long cdkeyId) {
        return zhenCdkeyMapper.selectZhenCdkeyByCdkeyId(cdkeyId);
    }

    /**
     * 查询礼包码列表
     *
     * @param zhenCdkey 礼包码
     * @return 礼包码
     */
    @Override
    public List<ZhenCdkey> selectZhenCdkeyList(ZhenCdkey zhenCdkey) {
        return zhenCdkeyMapper.selectZhenCdkeyList(zhenCdkey);
    }

    /**
     * 新增礼包码
     *
     * @param zhenCdkey 礼包码
     * @return 结果
     */
    @Override
    public int insertZhenCdkey(ZhenCdkey zhenCdkey) {
                zhenCdkey.setCreateTime(DateUtils.getNowDate());
            return zhenCdkeyMapper.insertZhenCdkey(zhenCdkey);
    }

    /**
     * 修改礼包码
     *
     * @param zhenCdkey 礼包码
     * @return 结果
     */
    @Override
    public int updateZhenCdkey(ZhenCdkey zhenCdkey) {
        return zhenCdkeyMapper.updateZhenCdkey(zhenCdkey);
    }

    /**
     * 批量删除礼包码
     *
     * @param cdkeyIds 需要删除的礼包码主键
     * @return 结果
     */
    @Override
    public int deleteZhenCdkeyByCdkeyIds(Long[] cdkeyIds) {
        return zhenCdkeyMapper.deleteZhenCdkeyByCdkeyIds(cdkeyIds);
    }

    /**
     * 删除礼包码信息
     *
     * @param cdkeyId 礼包码主键
     * @return 结果
     */
    @Override
    public int deleteZhenCdkeyByCdkeyId(Long cdkeyId) {
        return zhenCdkeyMapper.deleteZhenCdkeyByCdkeyId(cdkeyId);
    }
}
